package com.ncmmall.domain.business.order.delivery;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.ncmmall.domain.business.order.OrderDetail;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import javax.persistence.*;

/**
 * @author linxs
 * @Description: 采购订单发货记录详细
 * @Date: 2020-05-10 18:48
 */
@Entity
@Table(name = "mall_order_delivery_detail")
@Access(AccessType.FIELD)
@Getter
@Setter
public class SupplierOrderDeliveryDetail {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long id;

    /**
     * 所属发货记录
     */
    @JsonBackReference
    @ManyToOne
    @JoinColumn(name = "delivery_id")
    @NotFound(action = NotFoundAction.IGNORE)
    private SupplierOrderDelivery delivery;

    /**
     * 所属订单详细
     */
    @JsonBackReference
    @OneToOne
    private OrderDetail orderDetail;

    /**
     * 发货数量
     */
    private int deliveryQuantity;

}
